class GlobalSettings < ActiveRecord::Base
  
  def GlobalSettings.[](key_name)
    find_or_create_by_key key_name.to_s
  end
  
  def self.site_name
    find_or_create_by_key('site_name').value
  end
  
  def self.site_name=(new_value)
    find_or_create_by_key('site_name').update_attribute :value, new_value
  end
  
end
